<template>
	<!-- 预约状态 -->
	<view class="content display  displayColumn">
		<u-navbar title="个人中心" @rightClick="rightClick" :autoBack="true" :placeholder="true">
			<view class="appoint_left display  " slot="left">
				<uni-icons type="left" size="18" color="#000"></uni-icons>
			</view>
			<view class="apponit_center display " slot="center">
				<span class="title_txt fontSize font_comm" v-if="flag">预约成功</span>
				<span class="title_txt fontSize font_comm" v-else>预约失败</span>
				
			</view>
		</u-navbar>

		<view class="content_all display width-100 displayColumn ">
			<view class="one display  displayColumn width-100 ">
				<view class="one_top display displayColumn all_item width-100 ">
					<img class="img" src="@/static/img/car-manage.png" alt="" />
					<span class="fontSize font_comm M-T24" v-if="flag">预约成功</span>
					<span class="fontSize font_comm M-T24" v-if="!flag">预约失败</span>
					<span class="fontSize title_txt1 font_comm" style="font-weight: 400;font-size: 24rpx;color: #000000;" v-if="!flag">请修改预约时间段</span>
				</view>

				<view class="one_bottom display displayColumn width-100 M-T12">
					<span class="fontSize font_comm txt1 M-L-24" v-if="flag">请于</span>
					<span class="fontSize font_comm txt2 M-L-24 M-T12" v-if="flag">{{info.reservationDay}} <span
							class="fontSize font_comm txt3 M-L-16" v-if="info.reservationTime">{{info.reservationTime.split('-')[1]}}前</span> <span
							class="fontSize M-L-16 font_comm txt4">到达</span> </span>
					<view class="wode_lines1 M-T20"></view>
					<view class="one_one display  width-100 M-T20">
						<span class="fontSize font_comm">预约洗车站</span>
						<span class="fontSize font_comm">{{info.stationName}}</span>
					</view>
					<view class="one_one display  width-100 M-T20">
						<span class="fontSize font_comm">门店地址</span>
						<span class="fontSize font_comm">{{info.stationAdress}}</span>
					</view>
					<view class="one_one display  width-100 M-T20">
						<span class="fontSize font_comm">服务师傅</span>
						<span class="fontSize font_comm">{{info.workerName}}</span>
					</view>
					<view class="one_one display  width-100 M-T20" v-if="flag">
						<span class="fontSize font_comm">预约项目</span>
						<span class="fontSize font_comm">{{info.goodsName}}</span>
					</view>
					<!-- <view class="one_one display  width-100 M-T20" v-if="!flag" style="padding-bottom: 20rpx;">
						<span class="fontSize font_comm">预约项目</span>
						<span class="fontSize font_comm">人工洗车-车辆精洗</span>
					</view> -->
					<view class="one_one display  width-100 M-T20" v-if="flag" style="padding-bottom: 24rpx;">
						<span class="fontSize font_comm">联系商家</span>
						<img style="width: 32rpx;height: 32rpx;" src="@/static/img2/phone.png" @click="popup" alt="" />
						<!-- <span class="fontSize font_comm" @click="popup">石家庄站</span> -->
					</view>
				</view>

				</view>
				
				<view class="two display displayColumn width-100 " v-if="flag">
					<span class="fontSize font_comm" style="margin-left: 30rpx;">小贴士</span>
					<view class="two_all display displayColumn M-ALL-LR20 M-T20">
						<span class="font_comm fontSize txt1">1.预约后可直接取消，不影响您的下次预约</span>
						<span class="fontSize font_comm txt2">2.门站周围有停车场，凭消费证明可免费停车</span>
					</view>
				</view>
		</view>
		<u-popup :show="show" mode="center" :safeAreaInsetBottom="false" :round="12">
		            <view class="popupall display  displayColumn">
		               <view class="popup_one display  width-100 displaycenter_aliem " style="padding-top: 20rpx;">
		               	<span class="fontSize font_comm" >{{info.workerPhonenumber}}</span>
						<span class="fontSize font_comm" @click="makephone(info.workerPhonenumber)">拨打</span>
		               </view>
					   <view class="popup_one display  width-100 displaycenter_aliem">
					   	<span class="fontSize font_comm">{{info.stationPhonenumber}}</span>
					   	<span class="fontSize font_comm" @click="makephone(info.stationPhonenumber)">拨打</span>
					   </view>
					   <view class="dele_icon " @click="tocanclepopup">
					   	<uni-icons class="weizhi" type="closeempty" size="15"></uni-icons>
					   </view>
		            </view>
				</u-popup>
		<!-- 按钮 -->
		<view class="buttons1   " v-if="!flag">
			<view class="buttons_all1  display all_item">
				<span class="fontSize font_comm">立即重新预约</span>
			</view>
		</view>
		<view class="buttons   " v-if="flag">
			<view class="buttons_all  display all_item" @click="viewappoint">
				<span class="fontSize font_comm">查看我的预约</span>
			</view>
		</view>
		<view class="vipbutton " v-if="flag&&info.memberType == 0">
			<view class="cards display  all_item" @click="tovip">
				<span class="fontSize font_comm">开通VIP享受洗车折扣</span>
				<uni-icons type="right" color="#E4B808" size="18"></uni-icons>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show:false,
				flag:true,//true预约成功  false 预约失败
				id:'',
				info:{},//信息
				time:{
					one:'',
					two:''
				}
			}
		},
		onLoad(options){
			this.id = options.id;
			// 获取详情信息
			this.$modal.loading('正在加载');
			this.getdetailInfo();
		},
		methods: {
			//弹窗
			popup(){
				this.show = true;
			},
			tocanclepopup(){
				this.show = false;
			},
			makephone(e){
				let that = this;
				uni.makePhoneCall({
					phoneNumber: `${e}` //仅为示例
				});

			},
			// 查看预约
			viewappoint(){
				this.$tab.navigateTo(`/packageB/orderDetails/orderDetails?id=${this.id}`)
			},
			getdetailInfo(){
				this.$req.get(`/xcx/orderReservation/${this.id}`).then(res=>{
					console.log(res);
					this.$modal.closeLoading();
					if(res.data.code==200){
						this.info = res.data.data;
						
					}else{
						this.$modal.msg(res.data.msg);
					}
				})
			},
			// 充值
			tovip(){
				this.$tab.navigateTo('/pages/coupon/buyCoupon')
			}
		}
	}
</script>

<style>
	page {
		background: #F4F5FA;
	}
</style>
<style scoped lang="scss">
	.M-T24 {
		margin-top: 24rpx;
	}

	.M-T12 {
		margin-top: 12rpx;
	}

	.M-T20 {
		margin-top: 20rpx;
	}

	.M-L-24 {
		margin-left: 24rpx;
	}
	.M-ALL-LR20{
		margin-left: 20rpx;
		margin-right: 20rpx;
	}
	.M-L-16 {
		margin-left: 16rpx;
	}

	.width-100 {
		width: 100%;
	}

	.content {
		width: 100%;
		min-height: 100vh;
	}

	.title_txt {
		font-size: 32rpx;
		font-weight: 600;
		color: #212121;
	}
	.title_txt1{
		font-weight: 400;
		font-size: 24rpx;
		color: #000000;
		margin-top: 58rpx;
	}
	.content_all {
		min-height: 698rpx;
	}

	.one {
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		min-height: 550rpx;
		margin: 30rpx;
		width: 690rpx;

		.one_top {
			flex: 3;
			margin-top: 30rpx;

			span {
				font-weight: 600;
				font-size: 28rpx;
				color: #000000;
			}
		}

		.one_bottom {
			flex: 2;
			margin-top: 40rpx;
			justify-content: flex-start;
			align-items: flex-start;

			.one_one {
				justify-content: space-between;
				align-items: center;

				:nth-child(1) {
					font-weight: 400;
					font-size: 24rpx;
					color: #72778A;
					margin-left: 24rpx;
				}

				:nth-child(2) {
					font-weight: 600;
					font-size: 24rpx;
					color: #212121;
					margin-right: 24rpx;
				}
			}

			.txt1 {
				font-weight: 400;
				font-size: 24rpx;
				color: #000000;
			}

			.txt2 {
				font-weight: 600;
				font-size: 28rpx;
				color: #126BC9;
			}

			.txt3 {
				font-weight: 600;
				font-size: 28rpx;
				color: #126BC9;
			}

			.txt4 {
				font-weight: 400;
				font-size: 24rpx;
				color: #000000;
			}
		}


	}

	.img {
		width: 116rpx;
		height: 116rpx;
		border-radius: 50%;
	}

	.wode_lines1 {
		width: 642rpx;
		height: 0rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		border: 2rpx solid #F6F6F6;
		margin-left: 24rpx;
	}
	.two{
		margin-top: 36rpx;
		align-items: flex-start;
		span{
			justify-content: flex-start;
			font-weight: 600;
			font-size: 32rpx;
			color: #000000;
		}
		.two_all{
			align-items: flex-start;
			justify-content: center;
			width: 690rpx;
			height: 136rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			.txt1{
				margin-left: 24rpx;
				
				font-weight: 400;
				font-size: 24rpx;
				color: #000000;
			}
			.txt2{
				margin-left: 24rpx;
				margin-top: 20rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: #000000;
			}
		}
	}
	.buttons{
		left: 30rpx;
		position: absolute;
		bottom: 112rpx;
		width: 100%;
		height: 84rpx;
		.buttons_all{
			width: 690rpx;
			height: 84rpx;
			background: rgba(23,105,143,0.1);
			
			border: 2rpx solid;
			border-image: linear-gradient(90deg, rgba(23, 105, 143, 1), rgba(173, 157, 246, 1), rgba(23, 105, 143, 1)) 2 2;
			border-radius: 24rpx;
			span{
				font-weight: 600;
				font-size: 28rpx;
				color: #126BC9;
			}
		}
	}
	.buttons1{
		left: 30rpx;
		position: absolute;
		bottom: 112rpx;
		width: 100%;
		height: 84rpx;
		.buttons_all1{
			width: 690rpx;
			height: 84rpx;
			background: #126BC9;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			
			
			
			
			
			span{
				font-weight: 600;
				font-size: 28rpx;
				color: #FFFFFF;
			}
		}
	}
	.vipbutton{
		left: 80rpx;
		position: absolute;
		width: 100%;
		height: 72rpx;
		bottom: 212rpx;
	}
	.cards{
		
		width: 590rpx;
		height: 72rpx;
		background: #2B2A2F;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		align-items: center;
		span{
			font-weight: 600;
			font-size: 24rpx;
			color: #E4B808;
		}
	}
	.popupall{
		
		width: 586rpx;
		min-height:95rpx;
		background: #FFFFFF;
		border-radius: 12px 12px 12px 12px;
		.dele_icon{
			position: absolute;
			width: 55rpx;
			height: 55rpx;
			border-radius: 50%;
			background: #F6F6F6;
			bottom: -140rpx;
			left: 260rpx;
		}
		.popup_one{
			height: 40rpx;
			justify-content: space-between;
			
			padding-bottom: 20rpx;
			:nth-child(1){
				font-weight: 600;
				font-size: 14px;
				color: #000000;
				margin-left: 20rpx;
			}
			:nth-child(2){
				font-weight: 600;
				font-size: 14px;
				color: #126BC9;
				margin-right: 20rpx;
			}
		}
	}
	.weizhi{
		position: absolute;
		// top: 25rpx;
		// left: 30rpx;
		top: 6rpx;
		left: 12rpx;
	}
</style>